package com.qeado.content.dao.ibatis;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.qeado.common.dao.BaseDao;
import com.qeado.content.dao.CollegeInfoDao;
import com.qeado.content.model.CollegeInfo;

@SuppressWarnings("unchecked")
@Repository
public class CollegeInfoDaoImpl extends BaseDao implements CollegeInfoDao {

	@Override
	public void deleteColleage(String id) {
		this.getSqlMapClientTemplate().delete("deleteColleage", id);
	}

	@Override
	public List<CollegeInfo> getColleageCategoryList() {
		return this.getSqlMapClientTemplate().queryForList("getColleageCategoryList");
	}

	@Override
	public CollegeInfo getCollegeLogoById(String id) {
		return (CollegeInfo) this.getSqlMapClientTemplate().queryForObject("getCollegeLogoById", id);
	}

	@Override
	public void saveCollegeInfo(CollegeInfo colleageInfo) {
		this.getSqlMapClientTemplate().insert("saveCollegeInfo", colleageInfo);
	}

	@Override
	public List<CollegeInfo> searchColleage(CollegeInfo colleageInfo) {
		return this.getSqlMapClientTemplate().queryForList("searchColleage", colleageInfo);
	}

	@Override
	public CollegeInfo searchColleageById(String id) {
		return (CollegeInfo) this.getSqlMapClientTemplate().queryForObject("searchColleageById", id);
	}

	@Override
	public void updateCollegeInfo(CollegeInfo colleageInfo) {
		this.getSqlMapClientTemplate().update("updateCollegeInfo", colleageInfo);
	}

	@Override
	public void updateUserAdminFlag(CollegeInfo colleageInfo) {
		this.getSqlMapClientTemplate().update("updateUserAdminFlag", colleageInfo);
	}

	@Override
	public Object validateCollegeName(String colleageName) {
		return this.getSqlMapClientTemplate().queryForObject("validateCollegeName", colleageName);
	}

}
